<app-content-header
  [showSearch]="ifShowSearch"
  [search]="search"
  (actionClick)="goAdd()">
  <ng-template #search>
    <app-search [(data)]="searchSchema" [customItems]="customSchema" (bindSearch)="handleSearch()"></app-search>
  </ng-template>
</app-content-header>

<div class="cil-table-block">
  <st
    #st
    [scroll]="scroll"
    [data]="data"
    [columns]="columns"
    [widthMode]="{type: 'strict' }"
    [ps]="ps"
    [pi]="pi"
    [page]="stPage"
    [total]="total"
    [loading]="loading"
    (change)="onChange($event)">
    <ng-template st-row="handleStatus" let-item>
        <span>{{ postRiskEventStatusMap[item.handleStatus] | i18n }}</span>
    </ng-template>
  </st>
</div>

<ng-template #tplAcquirer>
  <app-aams-select
    level="institution"
    [(ngModel)]="selectedAcquirer"
    [disabled]="isAcquirerUser">
  </app-aams-select>
</ng-template>

<ng-template #tplGroup>
  <app-aams-select
    level="agent"
    [(ngModel)]="selectedGroup"
    [insCode]="selectedAcquirer ? selectedAcquirer.code : ''"
    [disabled]="isAgentUser">
  </app-aams-select>
</ng-template>

<ng-template #tplMerchant>
  <app-aams-select
    level="merchant"
    [(ngModel)]="selectedMerchant"
    [insCode]="selectedAcquirer ? selectedAcquirer.code : ''"
    [agentCode]="selectedGroup ? selectedGroup.code : ''"
    [disabled]="isMerchantUser">
  </app-aams-select>
</ng-template>

<ng-template #tplStore>
  <app-aams-select
    level="store"
    [(ngModel)]="selectedStore"
    [insCode]="selectedAcquirer ? selectedAcquirer.code : ''"
    [agentCode]="selectedGroup ? selectedGroup.code : ''"
    [intMerCode]="selectedMerchant ? selectedMerchant.code : ''"
    [disabled]="isStoreUser">
  </app-aams-select>
</ng-template>